package com.test.www.utils.log;

import com.test.www.utils.Config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志
 */
public class LogUtils {
    private static volatile LogUtils instance;
    private static final Logger logger = LoggerFactory.getLogger(LogUtils.class);
    public static LogUtils getInstance() {
        if (instance == null) {
            synchronized (LogUtils.class) {
                if (instance == null) {
                    instance = new LogUtils();
                }
            }

        }
        return instance;
    }

    public void info( String info ) {
        if (Config.isOpenLog) {
            logger.info(info);
        }
    }
    public void info( String info, Object var1 ) {
        if (Config.isOpenLog) {
            logger.info(info,var1);
        }
    }
    public void error( String info ) {
        if (Config.isOpenLog) {
            logger.error(info);
        }
    }
    public void error( String info,Object var1 ) {
        if (Config.isOpenLog) {
            logger.error(info, var1);
        }
    }
    public void error( String info ,Object var1,Object var2) {
        if (Config.isOpenLog) {
            logger.error(info,var1,var2);
        }
    }
    public void debug( String info ) {
        if (Config.isOpenLog) {
            logger.debug(info);
        }
    }
    public void debug( String info, Object var1 ) {
        if (Config.isOpenLog) {
            logger.debug(info,var1);
        }
    }
    public void trace( String info ) {
        if (Config.isOpenLog) {
            logger.trace(info);
        }
    }
    public void trace( String info, Object var1 ) {
        if (Config.isOpenLog) {
            logger.trace(info,var1);
        }
    }

}
